<template>
  <view class="goodsInfo_pop_body">
    <view class="pop_input">
      <nut-input v-model="value" :placeholder="props.text" clearable />
    </view>
    <view class="pop_table">
      <view class="pop_table_block" v-for="(item,index) in props.goodsPopPublic" :key="index" @click="choseThis(item)">
        {{item.ssopRemark }}
      </view>
    </view>

  </view>
  <view class="goods_pop_foot">
    <view class="buttons" @click="sure">确 定</view>
  </view>
</template>

<script lang="ts" setup>
import Taro from "@tarojs/taro";
import { ref } from "vue";
const value = ref<string>("");
const props = defineProps<{
  goodsPopPublic: any;
  popType: string;
  text: string;
}>();
const emit = defineEmits<{
  (e: "publicResult", args: any): void;
}>();
//const result = ref<any>("");
function choseThis(item) {
  value.value = item.ssopRemark;
}
function sure() {
  if (!value.value) {
    Taro.showToast({
      icon: 'none',
      title: props.text,
    });
    return;
  }
  emit('publicResult',value.value)
}
</script>
<style lang="scss">
.buttons {
  width: 650rpx;
  background: linear-gradient(90deg, #0966ff 2%, #0658de 99%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  height: 100rpx;
  border-radius: 50rpx;
  font-family: PingFang SC;
  font-size: 32rpx;
}
.goods_pop_foot {
  width: 100%;
  position: fixed;
  bottom: 0;
  display: flex;
  justify-content: center;
  margin-bottom: 24rpx;
}
.goodsInfo_pop_body {
  width: 100%;
  height: 70%;
  overflow: auto;
  box-sizing: border-box;
  padding-top: 35rpx;
  .pop_input {
    width: 702rpx;
    height: 72rpx;
    border-radius: 8rpx;
    margin-left: 24rpx;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    .nut-input {
      background-color: unset;
      padding: 0;
      font-family: PingFangSC-Regular;
      font-size: 24rpx;
      color: #252525;
    }
  }
  .pop_table {
    padding: 24rpx;
    box-sizing: border-box;
    height: 300rpx;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-content: baseline;
    //background-color: red;
    .pop_table_block {
      min-width: 96rpx;
      height: 56rpx;
      border-radius: 88rpx;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0 24rpx;
      background: #f6f6f6;
      margin-bottom: 20rpx;
    }
  }
}
</style>